3.3.5 \(\int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{c+d \sec (e+f x)} \, dx\) [205]

Optimal. Leaf size=153 \[ \frac {a^3 \tanh ^{-1}(\sin (e+f x))}{2 d f}+\frac {a^3 \left (c^2-3 c d+3 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{d^3 f}-\frac {2 a^3 (c-d)^{5/2} \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{d^3 \sqrt {c+d} f}-\frac {a^3 (c-3 d) \tan (e+f x)}{d^2 f}+\frac {a^3 \sec (e+f x) \tan (e+f x)}{2 d f} \]

[Out]

1/2*a^3*arctanh(sin(f*x+e))/d/f+a^3*(c^2-3*c*d+3*d^2)*arctanh(sin(f*x+e))/d^3/f-2*a^3*(c-d)^(5/2)*arctanh((c-d
)^(1/2)*tan(1/2*f*x+1/2*e)/(c+d)^(1/2))/d^3/f/(c+d)^(1/2)-a^3*(c-3*d)*tan(f*x+e)/d^2/f+1/2*a^3*sec(f*x+e)*tan(
f*x+e)/d/f

________________________________________________________________________________________

Rubi [A]
time = 0.22, antiderivative size = 257, normalized size of antiderivative = 1.68, number of steps used = 9, number of rules used = 9, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.290, Rules used = {4072, 104, 159, 163, 65, 223, 209, 95, 211} \begin {gather*} \frac {a^4 \left (2 c^2-6 c d+7 d^2\right ) \tan (e+f x) \text {ArcTan}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a (\sec (e+f x)+1)}}\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {2 a^4 (c-d)^{5/2} \tan (e+f x) \text {ArcTan}\left (\frac {\sqrt {c+d} \sqrt {a \sec (e+f x)+a}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right )}{d^3 f \sqrt {c+d} \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}-\frac {a^3 (2 c-5 d) \tan (e+f x)}{2 d^2 f}+\frac {\tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right )}{2 d f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(a + a*Sec[e + f*x])^3)/(c + d*Sec[e + f*x]),x]

[Out]

-1/2*(a^3*(2*c - 5*d)*Tan[e + f*x])/(d^2*f) + (a^4*(2*c^2 - 6*c*d + 7*d^2)*ArcTan[Sqrt[a - a*Sec[e + f*x]]/Sqr
t[a*(1 + Sec[e + f*x])]]*Tan[e + f*x])/(d^3*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]) + (2*a^4*(c -
 d)^(5/2)*ArcTan[(Sqrt[c + d]*Sqrt[a + a*Sec[e + f*x]])/(Sqrt[c - d]*Sqrt[a - a*Sec[e + f*x]])]*Tan[e + f*x])/
(d^3*Sqrt[c + d]*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]) + ((a^3 + a^3*Sec[e + f*x])*Tan[e + f*x]
)/(2*d*f)

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 95

Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_)), x_Symbol] :> With[{q = Denomin
ator[m]}, Dist[q, Subst[Int[x^(q*(m + 1) - 1)/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^
(1/q)], x]] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && LtQ[-1, m, 0] && SimplerQ[
a + b*x, c + d*x]

Rule 104

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(a +
b*x)^(m - 1)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(m + n + p + 1))), x] + Dist[1/(d*f*(m + n + p + 1)), I
nt[(a + b*x)^(m - 2)*(c + d*x)^n*(e + f*x)^p*Simp[a^2*d*f*(m + n + p + 1) - b*(b*c*e*(m - 1) + a*(d*e*(n + 1)
+ c*f*(p + 1))) + b*(a*d*f*(2*m + n + p) - b*(d*e*(m + n) + c*f*(m + p)))*x, x], x], x] /; FreeQ[{a, b, c, d,
e, f, n, p}, x] && GtQ[m, 1] && NeQ[m + n + p + 1, 0] && IntegersQ[2*m, 2*n, 2*p]

Rule 159

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)), x_Symb
ol] :> Simp[h*(a + b*x)^m*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(m + n + p + 2))), x] + Dist[1/(d*f*(m + n
 + p + 2)), Int[(a + b*x)^(m - 1)*(c + d*x)^n*(e + f*x)^p*Simp[a*d*f*g*(m + n + p + 2) - h*(b*c*e*m + a*(d*e*(
n + 1) + c*f*(p + 1))) + (b*d*f*g*(m + n + p + 2) + h*(a*d*f*m - b*(d*e*(m + n + 1) + c*f*(m + p + 1))))*x, x]
, x], x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && GtQ[m, 0] && NeQ[m + n + p + 2, 0] && IntegersQ[2*m, 2
*n, 2*p]

Rule 163

Int[(((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/((a_.) + (b_.)*(x_)), x_Symbol]
 :> Dist[h/b, Int[(c + d*x)^n*(e + f*x)^p, x], x] + Dist[(b*g - a*h)/b, Int[(c + d*x)^n*((e + f*x)^p/(a + b*x)
), x], x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 4072

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[a^2*g*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]
])), Subst[Int[(g*x)^(p - 1)*(a + b*x)^(m - 1/2)*((c + d*x)^n/Sqrt[a - b*x]), x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rubi steps

\begin {align*} \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{c+d \sec (e+f x)} \, dx &=-\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(a+a x)^{5/2}}{\sqrt {a-a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {\left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{2 d f}+\frac {(a \tan (e+f x)) \text {Subst}\left (\int \frac {\sqrt {a+a x} \left (-a^3 (c+2 d)+a^3 (2 c-5 d) x\right )}{\sqrt {a-a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{2 d f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=-\frac {a^3 (2 c-5 d) \tan (e+f x)}{2 d^2 f}+\frac {\left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{2 d f}-\frac {\tan (e+f x) \text {Subst}\left (\int \frac {a^5 d (c+2 d)+a^5 \left (2 c^2-6 c d+7 d^2\right ) x}{\sqrt {a-a x} \sqrt {a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{2 d^2 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=-\frac {a^3 (2 c-5 d) \tan (e+f x)}{2 d^2 f}+\frac {\left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{2 d f}+\frac {\left (a^5 (c-d)^3 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\left (a^5 \left (2 c^2-6 c d+7 d^2\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{2 d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=-\frac {a^3 (2 c-5 d) \tan (e+f x)}{2 d^2 f}+\frac {\left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{2 d f}+\frac {\left (2 a^5 (c-d)^3 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac {\sqrt {a+a \sec (e+f x)}}{\sqrt {a-a \sec (e+f x)}}\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {\left (a^4 \left (2 c^2-6 c d+7 d^2\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2 a-x^2}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=-\frac {a^3 (2 c-5 d) \tan (e+f x)}{2 d^2 f}+\frac {2 a^4 (c-d)^{5/2} \tan ^{-1}\left (\frac {\sqrt {c+d} \sqrt {a+a \sec (e+f x)}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 \sqrt {c+d} f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {\left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{2 d f}+\frac {\left (a^4 \left (2 c^2-6 c d+7 d^2\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=-\frac {a^3 (2 c-5 d) \tan (e+f x)}{2 d^2 f}+\frac {a^4 \left (2 c^2-6 c d+7 d^2\right ) \tan ^{-1}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {2 a^4 (c-d)^{5/2} \tan ^{-1}\left (\frac {\sqrt {c+d} \sqrt {a+a \sec (e+f x)}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 \sqrt {c+d} f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {\left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{2 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 2.43, size = 419, normalized size = 2.74 \begin {gather*} \frac {a^3 \cos ^2(e+f x) (d+c \cos (e+f x)) \sec ^6\left (\frac {1}{2} (e+f x)\right ) (1+\sec (e+f x))^3 \left (-2 \left (2 c^2-6 c d+7 d^2\right ) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+2 \left (2 c^2-6 c d+7 d^2\right ) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+\frac {8 (c-d)^3 \text {ArcTan}\left (\frac {(i \cos (e)+\sin (e)) \left (c \sin (e)+(-d+c \cos (e)) \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right ) (i \cos (e)+\sin (e))}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}+\frac {d^2}{\left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^2}-\frac {4 (c-3 d) d \sin \left (\frac {f x}{2}\right )}{\left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}-\frac {d^2}{\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2}-\frac {4 (c-3 d) d \sin \left (\frac {f x}{2}\right )}{\left (\cos \left (\frac {e}{2}\right )+\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}\right )}{32 d^3 f (c+d \sec (e+f x))} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x])^3)/(c + d*Sec[e + f*x]),x]

[Out]

(a^3*Cos[e + f*x]^2*(d + c*Cos[e + f*x])*Sec[(e + f*x)/2]^6*(1 + Sec[e + f*x])^3*(-2*(2*c^2 - 6*c*d + 7*d^2)*L
og[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + 2*(2*c^2 - 6*c*d + 7*d^2)*Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]] +
 (8*(c - d)^3*ArcTan[((I*Cos[e] + Sin[e])*(c*Sin[e] + (-d + c*Cos[e])*Tan[(f*x)/2]))/(Sqrt[c^2 - d^2]*Sqrt[(Co
s[e] - I*Sin[e])^2])]*(I*Cos[e] + Sin[e]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2]) + d^2/(Cos[(e + f*x)/
2] - Sin[(e + f*x)/2])^2 - (4*(c - 3*d)*d*Sin[(f*x)/2])/((Cos[e/2] - Sin[e/2])*(Cos[(e + f*x)/2] - Sin[(e + f*
x)/2])) - d^2/(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2 - (4*(c - 3*d)*d*Sin[(f*x)/2])/((Cos[e/2] + Sin[e/2])*(C
os[(e + f*x)/2] + Sin[(e + f*x)/2]))))/(32*d^3*f*(c + d*Sec[e + f*x]))

________________________________________________________________________________________

Maple [A]
time = 0.38, size = 224, normalized size = 1.46

method result size
derivativedivides \(\frac {16 a^{3} \left (-\frac {\left (c^{3}-3 c^{2} d +3 c \,d^{2}-d^{3}\right ) \arctanh \left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{8 d^{3} \sqrt {\left (c +d \right ) \left (c -d \right )}}-\frac {1}{32 d \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {-2 c +5 d}{32 d^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}+\frac {\left (2 c^{2}-6 c d +7 d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{32 d^{3}}+\frac {1}{32 d \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2}}-\frac {-2 c +5 d}{32 d^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}+\frac {\left (-2 c^{2}+6 c d -7 d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{32 d^{3}}\right )}{f}\) \(224\)
default \(\frac {16 a^{3} \left (-\frac {\left (c^{3}-3 c^{2} d +3 c \,d^{2}-d^{3}\right ) \arctanh \left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{8 d^{3} \sqrt {\left (c +d \right ) \left (c -d \right )}}-\frac {1}{32 d \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {-2 c +5 d}{32 d^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}+\frac {\left (2 c^{2}-6 c d +7 d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{32 d^{3}}+\frac {1}{32 d \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2}}-\frac {-2 c +5 d}{32 d^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}+\frac {\left (-2 c^{2}+6 c d -7 d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{32 d^{3}}\right )}{f}\) \(224\)
risch \(-\frac {i a^{3} \left (d \,{\mathrm e}^{3 i \left (f x +e \right )}+2 \,{\mathrm e}^{2 i \left (f x +e \right )} c -6 d \,{\mathrm e}^{2 i \left (f x +e \right )}-d \,{\mathrm e}^{i \left (f x +e \right )}+2 c -6 d \right )}{f \,d^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c^{2}}{d^{3} f}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c}{d^{2} f}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{2 d f}+\frac {\sqrt {\left (c +d \right ) \left (c -d \right )}\, a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}-d}{c}\right ) c^{2}}{\left (c +d \right ) f \,d^{3}}-\frac {2 \sqrt {\left (c +d \right ) \left (c -d \right )}\, a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}-d}{c}\right ) c}{\left (c +d \right ) f \,d^{2}}+\frac {\sqrt {\left (c +d \right ) \left (c -d \right )}\, a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}-d}{c}\right )}{\left (c +d \right ) f d}-\frac {\sqrt {\left (c +d \right ) \left (c -d \right )}\, a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}+d}{c}\right ) c^{2}}{\left (c +d \right ) f \,d^{3}}+\frac {2 \sqrt {\left (c +d \right ) \left (c -d \right )}\, a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}+d}{c}\right ) c}{\left (c +d \right ) f \,d^{2}}-\frac {\sqrt {\left (c +d \right ) \left (c -d \right )}\, a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}+d}{c}\right )}{\left (c +d \right ) f d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c^{2}}{d^{3} f}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c}{d^{2} f}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{2 d f}\) \(595\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

16/f*a^3*(-1/8*(c^3-3*c^2*d+3*c*d^2-d^3)/d^3/((c+d)*(c-d))^(1/2)*arctanh((c-d)*tan(1/2*f*x+1/2*e)/((c+d)*(c-d)
)^(1/2))-1/32/d/(tan(1/2*f*x+1/2*e)+1)^2-1/32*(-2*c+5*d)/d^2/(tan(1/2*f*x+1/2*e)+1)+1/32*(2*c^2-6*c*d+7*d^2)/d
^3*ln(tan(1/2*f*x+1/2*e)+1)+1/32/d/(tan(1/2*f*x+1/2*e)-1)^2-1/32*(-2*c+5*d)/d^2/(tan(1/2*f*x+1/2*e)-1)+1/32/d^
3*(-2*c^2+6*c*d-7*d^2)*ln(tan(1/2*f*x+1/2*e)-1))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [A]
time = 3.45, size = 556, normalized size = 3.63 \begin {gather*} \left [\frac {2 \, {\left (a^{3} c^{2} - 2 \, a^{3} c d + a^{3} d^{2}\right )} \sqrt {\frac {c - d}{c + d}} \cos \left (f x + e\right )^{2} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (c^{2} + c d + {\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt {\frac {c - d}{c + d}} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) + {\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (a^{3} d^{2} - 2 \, {\left (a^{3} c d - 3 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, d^{3} f \cos \left (f x + e\right )^{2}}, -\frac {4 \, {\left (a^{3} c^{2} - 2 \, a^{3} c d + a^{3} d^{2}\right )} \sqrt {-\frac {c - d}{c + d}} \arctan \left (-\frac {{\left (d \cos \left (f x + e\right ) + c\right )} \sqrt {-\frac {c - d}{c + d}}}{{\left (c - d\right )} \sin \left (f x + e\right )}\right ) \cos \left (f x + e\right )^{2} - {\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) + {\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (a^{3} d^{2} - 2 \, {\left (a^{3} c d - 3 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, d^{3} f \cos \left (f x + e\right )^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e)),x, algorithm="fricas")

[Out]

[1/4*(2*(a^3*c^2 - 2*a^3*c*d + a^3*d^2)*sqrt((c - d)/(c + d))*cos(f*x + e)^2*log((2*c*d*cos(f*x + e) - (c^2 -
2*d^2)*cos(f*x + e)^2 - 2*(c^2 + c*d + (c*d + d^2)*cos(f*x + e))*sqrt((c - d)/(c + d))*sin(f*x + e) + 2*c^2 -
d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) + (2*a^3*c^2 - 6*a^3*c*d + 7*a^3*d^2)*cos(f*x + e)^2*log
(sin(f*x + e) + 1) - (2*a^3*c^2 - 6*a^3*c*d + 7*a^3*d^2)*cos(f*x + e)^2*log(-sin(f*x + e) + 1) + 2*(a^3*d^2 -
2*(a^3*c*d - 3*a^3*d^2)*cos(f*x + e))*sin(f*x + e))/(d^3*f*cos(f*x + e)^2), -1/4*(4*(a^3*c^2 - 2*a^3*c*d + a^3
*d^2)*sqrt(-(c - d)/(c + d))*arctan(-(d*cos(f*x + e) + c)*sqrt(-(c - d)/(c + d))/((c - d)*sin(f*x + e)))*cos(f
*x + e)^2 - (2*a^3*c^2 - 6*a^3*c*d + 7*a^3*d^2)*cos(f*x + e)^2*log(sin(f*x + e) + 1) + (2*a^3*c^2 - 6*a^3*c*d
+ 7*a^3*d^2)*cos(f*x + e)^2*log(-sin(f*x + e) + 1) - 2*(a^3*d^2 - 2*(a^3*c*d - 3*a^3*d^2)*cos(f*x + e))*sin(f*
x + e))/(d^3*f*cos(f*x + e)^2)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int \frac {\sec {\left (e + f x \right )}}{c + d \sec {\left (e + f x \right )}}\, dx + \int \frac {3 \sec ^{2}{\left (e + f x \right )}}{c + d \sec {\left (e + f x \right )}}\, dx + \int \frac {3 \sec ^{3}{\left (e + f x \right )}}{c + d \sec {\left (e + f x \right )}}\, dx + \int \frac {\sec ^{4}{\left (e + f x \right )}}{c + d \sec {\left (e + f x \right )}}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**3/(c+d*sec(f*x+e)),x)

[Out]

a**3*(Integral(sec(e + f*x)/(c + d*sec(e + f*x)), x) + Integral(3*sec(e + f*x)**2/(c + d*sec(e + f*x)), x) + I
ntegral(3*sec(e + f*x)**3/(c + d*sec(e + f*x)), x) + Integral(sec(e + f*x)**4/(c + d*sec(e + f*x)), x))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 285 vs. \(2 (140) = 280\).
time = 0.57, size = 285, normalized size = 1.86 \begin {gather*} \frac {\frac {{\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{d^{3}} - \frac {{\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{d^{3}} + \frac {4 \, {\left (a^{3} c^{3} - 3 \, a^{3} c^{2} d + 3 \, a^{3} c d^{2} - a^{3} d^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )}}{\sqrt {-c^{2} + d^{2}} d^{3}} + \frac {2 \, {\left (2 \, a^{3} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 5 \, a^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 \, a^{3} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 7 \, a^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{2} d^{2}}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e)),x, algorithm="giac")

[Out]

1/2*((2*a^3*c^2 - 6*a^3*c*d + 7*a^3*d^2)*log(abs(tan(1/2*f*x + 1/2*e) + 1))/d^3 - (2*a^3*c^2 - 6*a^3*c*d + 7*a
^3*d^2)*log(abs(tan(1/2*f*x + 1/2*e) - 1))/d^3 + 4*(a^3*c^3 - 3*a^3*c^2*d + 3*a^3*c*d^2 - a^3*d^3)*(pi*floor(1
/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*tan(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d
^2)))/(sqrt(-c^2 + d^2)*d^3) + 2*(2*a^3*c*tan(1/2*f*x + 1/2*e)^3 - 5*a^3*d*tan(1/2*f*x + 1/2*e)^3 - 2*a^3*c*ta
n(1/2*f*x + 1/2*e) + 7*a^3*d*tan(1/2*f*x + 1/2*e))/((tan(1/2*f*x + 1/2*e)^2 - 1)^2*d^2))/f

________________________________________________________________________________________

Mupad [B]
time = 2.89, size = 1902, normalized size = 12.43 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(e + f*x))^3/(cos(e + f*x)*(c + d/cos(e + f*x))),x)

[Out]

(atanh((18824*a^9*c^2*tan(e/2 + (f*x)/2))/(18824*a^9*c^2 + 2968*a^9*d^2 - (16680*a^9*c^3)/d + (8608*a^9*c^4)/d
^2 - (2480*a^9*c^5)/d^3 + (320*a^9*c^6)/d^4 - 11560*a^9*c*d) - (16680*a^9*c^3*tan(e/2 + (f*x)/2))/(2968*a^9*d^
3 - 16680*a^9*c^3 - 11560*a^9*c*d^2 + 18824*a^9*c^2*d + (8608*a^9*c^4)/d - (2480*a^9*c^5)/d^2 + (320*a^9*c^6)/
d^3) + (8608*a^9*c^4*tan(e/2 + (f*x)/2))/(8608*a^9*c^4 + 2968*a^9*d^4 - 11560*a^9*c*d^3 - 16680*a^9*c^3*d + 18
824*a^9*c^2*d^2 - (2480*a^9*c^5)/d + (320*a^9*c^6)/d^2) - (2480*a^9*c^5*tan(e/2 + (f*x)/2))/(2968*a^9*d^5 - 24
80*a^9*c^5 - 11560*a^9*c*d^4 + 8608*a^9*c^4*d + 18824*a^9*c^2*d^3 - 16680*a^9*c^3*d^2 + (320*a^9*c^6)/d) + (32
0*a^9*c^6*tan(e/2 + (f*x)/2))/(320*a^9*c^6 + 2968*a^9*d^6 - 11560*a^9*c*d^5 - 2480*a^9*c^5*d + 18824*a^9*c^2*d
^4 - 16680*a^9*c^3*d^3 + 8608*a^9*c^4*d^2) + (2968*a^9*d^2*tan(e/2 + (f*x)/2))/(18824*a^9*c^2 + 2968*a^9*d^2 -
 (16680*a^9*c^3)/d + (8608*a^9*c^4)/d^2 - (2480*a^9*c^5)/d^3 + (320*a^9*c^6)/d^4 - 11560*a^9*c*d) - (11560*a^9
*c*d*tan(e/2 + (f*x)/2))/(18824*a^9*c^2 + 2968*a^9*d^2 - (16680*a^9*c^3)/d + (8608*a^9*c^4)/d^2 - (2480*a^9*c^
5)/d^3 + (320*a^9*c^6)/d^4 - 11560*a^9*c*d))*(2*a^3*c^2 + 7*a^3*d^2 - 6*a^3*c*d))/(d^3*f) - ((tan(e/2 + (f*x)/
2)*(2*a^3*c - 7*a^3*d))/d^2 - (a^3*tan(e/2 + (f*x)/2)^3*(2*c - 5*d))/d^2)/(f*(tan(e/2 + (f*x)/2)^4 - 2*tan(e/2
 + (f*x)/2)^2 + 1)) - (a^3*atan(((a^3*((c + d)*(c - d)^5)^(1/2)*((8*tan(e/2 + (f*x)/2)*(8*a^6*c^7 - 53*a^6*d^7
 + 259*a^6*c*d^6 - 64*a^6*c^6*d - 547*a^6*c^2*d^5 + 657*a^6*c^3*d^4 - 492*a^6*c^4*d^3 + 232*a^6*c^5*d^2))/d^4
+ (a^3*((c + d)*(c - d)^5)^(1/2)*((8*(18*a^3*d^10 - 46*a^3*c*d^9 + 42*a^3*c^2*d^8 - 18*a^3*c^3*d^7 + 4*a^3*c^4
*d^6))/d^6 - (8*a^3*tan(e/2 + (f*x)/2)*((c + d)*(c - d)^5)^(1/2)*(8*c*d^8 - 16*c^2*d^7 + 8*c^3*d^6))/(d^7*(c +
 d))))/(d^3*(c + d)))*1i)/(d^3*(c + d)) + (a^3*((c + d)*(c - d)^5)^(1/2)*((8*tan(e/2 + (f*x)/2)*(8*a^6*c^7 - 5
3*a^6*d^7 + 259*a^6*c*d^6 - 64*a^6*c^6*d - 547*a^6*c^2*d^5 + 657*a^6*c^3*d^4 - 492*a^6*c^4*d^3 + 232*a^6*c^5*d
^2))/d^4 - (a^3*((c + d)*(c - d)^5)^(1/2)*((8*(18*a^3*d^10 - 46*a^3*c*d^9 + 42*a^3*c^2*d^8 - 18*a^3*c^3*d^7 +
4*a^3*c^4*d^6))/d^6 + (8*a^3*tan(e/2 + (f*x)/2)*((c + d)*(c - d)^5)^(1/2)*(8*c*d^8 - 16*c^2*d^7 + 8*c^3*d^6))/
(d^7*(c + d))))/(d^3*(c + d)))*1i)/(d^3*(c + d)))/((16*(4*a^9*c^8 + 35*a^9*d^8 - 219*a^9*c*d^7 - 42*a^9*c^7*d
+ 592*a^9*c^2*d^6 - 904*a^9*c^3*d^5 + 855*a^9*c^4*d^4 - 515*a^9*c^5*d^3 + 194*a^9*c^6*d^2))/d^6 - (a^3*((c + d
)*(c - d)^5)^(1/2)*((8*tan(e/2 + (f*x)/2)*(8*a^6*c^7 - 53*a^6*d^7 + 259*a^6*c*d^6 - 64*a^6*c^6*d - 547*a^6*c^2
*d^5 + 657*a^6*c^3*d^4 - 492*a^6*c^4*d^3 + 232*a^6*c^5*d^2))/d^4 + (a^3*((c + d)*(c - d)^5)^(1/2)*((8*(18*a^3*
d^10 - 46*a^3*c*d^9 + 42*a^3*c^2*d^8 - 18*a^3*c^3*d^7 + 4*a^3*c^4*d^6))/d^6 - (8*a^3*tan(e/2 + (f*x)/2)*((c +
d)*(c - d)^5)^(1/2)*(8*c*d^8 - 16*c^2*d^7 + 8*c^3*d^6))/(d^7*(c + d))))/(d^3*(c + d))))/(d^3*(c + d)) + (a^3*(
(c + d)*(c - d)^5)^(1/2)*((8*tan(e/2 + (f*x)/2)*(8*a^6*c^7 - 53*a^6*d^7 + 259*a^6*c*d^6 - 64*a^6*c^6*d - 547*a
^6*c^2*d^5 + 657*a^6*c^3*d^4 - 492*a^6*c^4*d^3 + 232*a^6*c^5*d^2))/d^4 - (a^3*((c + d)*(c - d)^5)^(1/2)*((8*(1
8*a^3*d^10 - 46*a^3*c*d^9 + 42*a^3*c^2*d^8 - 18*a^3*c^3*d^7 + 4*a^3*c^4*d^6))/d^6 + (8*a^3*tan(e/2 + (f*x)/2)*
((c + d)*(c - d)^5)^(1/2)*(8*c*d^8 - 16*c^2*d^7 + 8*c^3*d^6))/(d^7*(c + d))))/(d^3*(c + d))))/(d^3*(c + d))))*
((c + d)*(c - d)^5)^(1/2)*2i)/(d^3*f*(c + d))

________________________________________________________________________________________